<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
    * {
      padding: 0;
      margin: 0;
      list-style: none;
    }
    #ul {
      position: relative;
      top: 0px;
      left: 0px;
    }
    li {
      width: 200px;
      height: 100px;
      margin: 10px;
      background-color: #f00;
      color: #fff;
      text-align: center;
      font-size: 60px;
      transition: all 0.3s ease-out;
    }
  </style>
</head>
<body>
<div id="app" style="height: 300px;overflow: hidden;">
  <ul id="ul">
    <li v-for="item in items">{{item}}</li>
  </ul>
</div>
<button id="start">走起来</button>
<button id="reset">复位</button>
<script src="https://cdn.staticfile.org/vue/2.6.14/vue.min.js"></script>
<script>

  const ul = document.getElementById('ul')
  const stop = document.getElementById('#app')
  let timerId
  let v= new Vue({
    el:'#app',
    data:{
      items:[1,2,3,4]
    },
    created:function () {
      if(timerId) return
      timerId = setInterval(() => {
        const firstLi = document.querySelector('#ul li:first-child')
        ul.style.transition = 'all 0.5s ease-out'
        firstLi.style.opacity = 0
        ul.style.top = -110 + 'px'
        setTimeout(() => {
          firstLi.removeAttribute('style')
          ul.appendChild(firstLi)
          ul.style.transition = ''
          ul.style.top = 0
        }, 500)
      }, 2000)
    }
  })

</script>
</body>
</html>